package com.hgyc.mom.qms.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.hgyc.mom.common.annotation.Excel;
import com.hgyc.mom.core.annotation.DictColumn;
import com.hgyc.mom.core.annotation.TableDict;
import com.hgyc.mom.core.mybatis.EQ;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * <p>
 * 检测模板-检测项
 * </p>
 *
 * @author fwj
 * @since 2025-09-26
 */
@Data
@TableName("qms_template_index")
@Schema(name="检测模板-检测项对象", description="检测模板-检测项对象")
public class QmsTemplateIndex implements Serializable {
    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.ASSIGN_ID)
    @Schema(description = "记录ID")
    private Long id;

    @EQ
    @Schema(description = "检测模板ID")
    private Long templateId;

    @Schema(description = "检测项ID")
    @TableDict(table = "qms_index", key = "id" , columns = {
            @DictColumn(name ="index_code", alias = "indexCode"),
            @DictColumn(name = "index_name", alias = "indexName")
    })
    private Long indexId;

    @Excel(name = "检测工具")
    @Schema(description = "检测工具")
    private String qcTool;

    @Excel(name = "检测方法")
    @Schema(description = "检测方法")
    private String checkMethod;

    @Excel(name = "标准值")
    @Schema(description = "标准值")
    private BigDecimal standerVal;

    @Excel(name = "单位")
    @Schema(description = "单位")
    private String unitOfMeasure;

    @Excel(name = "误差上限")
    @Schema(description = "误差上限")
    private BigDecimal thresholdMax;

    @Excel(name = "误差下限")
    @Schema(description = "误差下限")
    private BigDecimal thresholdMin;

    @Excel(name = "备注")
    @Schema(description = "备注")
    private String remark;

    @TableField(fill = FieldFill.INSERT)
    @Schema(description = "创建者")
    private Long createBy;

    @TableField(fill = FieldFill.INSERT)
    @Schema(description = "创建时间")
    private LocalDateTime createTime;

    @TableField(fill = FieldFill.UPDATE)
    @Schema(description = "更新者")
    private Long updateBy;

    @TableField(fill = FieldFill.UPDATE)
    @Schema(description = "更新时间")
    private LocalDateTime updateTime;

}
